<?php
/**
 * Created by PhpStorm.
 * User: tangchao
 * Date: 19-4-19
 * Time: 下午3:49
 */

namespace Lib\Db;

use Lib\IDataBase;
class PDO implements IDataBase
{
    protected $conn;
    function connect($host, $user, $passwd, $dbname)
    {
        $this->conn = new \PDO("mysql:host=$host;dbname=$dbname",$user,$passwd);
    }

    function query($sql)
    {
        return $this->conn->query($sql);
    }

    function close()
    {
        unset($this->conn);
    }
}
